.class public Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;
.super Landroidx/recyclerview/widget/RecyclerView$Adapter;
.source "NewMediaPickerAdapter.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter$d;,
        Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter$e;
    }
.end annotation


# instance fields
.field private a:Landroid/content/Context;

.field private b:Landroid/view/LayoutInflater;

.field private c:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList<",
            "Les/qa;",
            ">;"
        }
    .end annotation
.end field

.field private d:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList<",
            "Les/qa;",
            ">;"
        }
    .end annotation
.end field

.field private e:Lcom/esfile/screen/recorder/media/util/y;

.field private f:I

.field private g:Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter$d;


# direct methods
.method public constructor <init>(Landroid/content/Context;Ljava/util/ArrayList;Lcom/esfile/screen/recorder/media/util/y;I)V
    .locals 0
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            "Ljava/util/ArrayList<",
            "Les/qa;",
            ">;",
            "Lcom/esfile/screen/recorder/media/util/y;",
            "I)V"
        }
    .end annotation

    .line 1
    invoke-direct {p0}, Landroidx/recyclerview/widget/RecyclerView$Adapter;-><init>()V

    .line 2
    iput-object p1, p0, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;->a:Landroid/content/Context;

    .line 3
    invoke-static {p1}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object p1

    iput-object p1, p0, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;->b:Landroid/view/LayoutInflater;

    .line 4
    iput-object p2, p0, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;->c:Ljava/util/ArrayList;

    .line 5
    iput-object p3, p0, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;->e:Lcom/esfile/screen/recorder/media/util/y;

    .line 6
    iput p4, p0, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;->f:I

    return-void
.end method

.method static synthetic a(Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;)Ljava/util/ArrayList;
    .locals 0

    .line 2
    iget-object p0, p0, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;->d:Ljava/util/ArrayList;

    return-object p0
.end method

.method static synthetic a(Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;Les/qa;)Z
    .locals 0

    .line 1
    invoke-direct {p0, p1}, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;->a(Les/qa;)Z

    move-result p0

    return p0
.end method

.method private a(Les/qa;)Z
    .locals 5

    .line 3
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;->d:Ljava/util/ArrayList;

    if-nez v0, :cond_0

    .line 4
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;->d:Ljava/util/ArrayList;

    .line 5
    :cond_0
    iget v0, p0, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;->f:I

    const/4 v1, -0x1

    const/4 v2, 0x0

    if-eq v0, v1, :cond_1

    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;->d:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    iget v1, p0, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;->f:I

    if-lt v0, v1, :cond_1

    return v2

    .line 6
    :cond_1
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;->d:Ljava/util/ArrayList;

    invoke-virtual {v0, p1}, Ljava/util/ArrayList;->contains(Ljava/lang/Object;)Z

    move-result v0

    .line 7
    iget-object v1, p0, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;->g:Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter$d;

    iget-object v3, p0, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;->d:Ljava/util/ArrayList;

    xor-int/lit8 v4, v0, 0x1

    invoke-interface {v1, v3, p1, v4}, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter$d;->a(Ljava/util/ArrayList;Les/qa;Z)Z

    move-result v1

    if-nez v1, :cond_2

    return v2

    :cond_2
    if-eqz v0, :cond_3

    .line 8
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;->d:Ljava/util/ArrayList;

    invoke-virtual {v0, p1}, Ljava/util/ArrayList;->remove(Ljava/lang/Object;)Z

    goto :goto_0

    .line 9
    :cond_3
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;->d:Ljava/util/ArrayList;

    invoke-virtual {v0, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 10
    :goto_0
    invoke-virtual {p0}, Landroidx/recyclerview/widget/RecyclerView$Adapter;->notifyDataSetChanged()V

    const/4 p1, 0x1

    return p1
.end method


# virtual methods
.method public a()Ljava/util/ArrayList;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/ArrayList<",
            "Les/qa;",
            ">;"
        }
    .end annotation

    .line 11
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;->d:Ljava/util/ArrayList;

    return-object v0
.end method

.method public a(Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter$d;)V
    .locals 0
    .param p1    # Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter$d;
        .annotation build Landroidx/annotation/NonNull;
        .end annotation
    .end param

    .line 12
    iput-object p1, p0, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;->g:Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter$d;

    return-void
.end method

.method public getItemCount()I
    .locals 1

    .line 1
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;->c:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    return v0
.end method

.method public getItemViewType(I)I
    .locals 1

    .line 1
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;->c:Ljava/util/ArrayList;

    invoke-virtual {v0, p1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Les/qa;

    invoke-virtual {p1}, Les/qa;->b()I

    move-result p1

    return p1
.end method

.method public onBindViewHolder(Landroidx/recyclerview/widget/RecyclerView$ViewHolder;I)V
    .locals 2
    .param p1    # Landroidx/recyclerview/widget/RecyclerView$ViewHolder;
        .annotation build Landroidx/annotation/NonNull;
        .end annotation
    .end param

    .line 1
    invoke-virtual {p0, p2}, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;->getItemViewType(I)I

    move-result v0

    if-nez v0, :cond_0

    .line 2
    check-cast p1, Lcom/esfile/screen/recorder/picture/newpicker/adapter/holder/PickerVideoHolder;

    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;->c:Ljava/util/ArrayList;

    invoke-virtual {v0, p2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Les/qa;

    invoke-virtual {p1, v0, p2}, Lcom/esfile/screen/recorder/picture/newpicker/adapter/holder/PickerVideoHolder;->a(Les/qa;I)V

    goto :goto_0

    :cond_0
    const/4 v1, 0x1

    if-ne v0, v1, :cond_1

    .line 3
    check-cast p1, Lcom/esfile/screen/recorder/picture/newpicker/adapter/holder/PickerImageHolder;

    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;->c:Ljava/util/ArrayList;

    invoke-virtual {v0, p2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Les/qa;

    invoke-virtual {p1, v0, p2}, Lcom/esfile/screen/recorder/picture/newpicker/adapter/holder/PickerImageHolder;->a(Les/qa;I)V

    goto :goto_0

    :cond_1
    const/4 v1, 0x2

    if-ne v0, v1, :cond_2

    .line 4
    check-cast p1, Lcom/esfile/screen/recorder/picture/newpicker/adapter/holder/PickerVideoAndImageHolder;

    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;->c:Ljava/util/ArrayList;

    invoke-virtual {v0, p2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Les/qa;

    invoke-virtual {p1, v0, p2}, Lcom/esfile/screen/recorder/picture/newpicker/adapter/holder/PickerVideoAndImageHolder;->a(Les/qa;I)V

    :cond_2
    :goto_0
    return-void
.end method

.method public onCreateViewHolder(Landroid/view/ViewGroup;I)Landroidx/recyclerview/widget/RecyclerView$ViewHolder;
    .locals 2
    .param p1    # Landroid/view/ViewGroup;
        .annotation build Landroidx/annotation/NonNull;
        .end annotation
    .end param
    .annotation build Landroidx/annotation/NonNull;
    .end annotation

    const/4 v0, 0x0

    const/4 v1, 0x1

    if-ne p2, v1, :cond_0

    .line 1
    iget-object p2, p0, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;->b:Landroid/view/LayoutInflater;

    sget v1, Les/y4;->durec_media_picker_image_item:I

    invoke-virtual {p2, v1, p1, v0}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object p1

    .line 2
    new-instance p2, Lcom/esfile/screen/recorder/picture/newpicker/adapter/holder/PickerImageHolder;

    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;->e:Lcom/esfile/screen/recorder/media/util/y;

    new-instance v1, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter$a;

    invoke-direct {v1, p0}, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter$a;-><init>(Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;)V

    invoke-direct {p2, p1, v0, v1}, Lcom/esfile/screen/recorder/picture/newpicker/adapter/holder/PickerImageHolder;-><init>(Landroid/view/View;Lcom/esfile/screen/recorder/media/util/y;Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter$e;)V

    return-object p2

    :cond_0
    const/4 v1, 0x2

    if-ne p2, v1, :cond_1

    .line 3
    iget-object p2, p0, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;->b:Landroid/view/LayoutInflater;

    sget v1, Les/y4;->durec_media_picker_video_item:I

    invoke-virtual {p2, v1, p1, v0}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object p1

    .line 4
    new-instance p2, Lcom/esfile/screen/recorder/picture/newpicker/adapter/holder/PickerVideoAndImageHolder;

    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;->e:Lcom/esfile/screen/recorder/media/util/y;

    new-instance v1, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter$b;

    invoke-direct {v1, p0}, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter$b;-><init>(Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;)V

    invoke-direct {p2, p1, v0, v1}, Lcom/esfile/screen/recorder/picture/newpicker/adapter/holder/PickerVideoAndImageHolder;-><init>(Landroid/view/View;Lcom/esfile/screen/recorder/media/util/y;Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter$e;)V

    return-object p2

    .line 5
    :cond_1
    iget-object p2, p0, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;->b:Landroid/view/LayoutInflater;

    sget v1, Les/y4;->durec_media_picker_video_item:I

    invoke-virtual {p2, v1, p1, v0}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object p1

    .line 6
    new-instance p2, Lcom/esfile/screen/recorder/picture/newpicker/adapter/holder/PickerVideoHolder;

    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;->e:Lcom/esfile/screen/recorder/media/util/y;

    new-instance v1, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter$c;

    invoke-direct {v1, p0}, Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter$c;-><init>(Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter;)V

    invoke-direct {p2, p1, v0, v1}, Lcom/esfile/screen/recorder/picture/newpicker/adapter/holder/PickerVideoHolder;-><init>(Landroid/view/View;Lcom/esfile/screen/recorder/media/util/y;Lcom/esfile/screen/recorder/picture/newpicker/adapter/NewMediaPickerAdapter$e;)V

    return-object p2
.end method
